package cn.pid21.client.model;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import java.util.List;

/**
 * PID 核心元数据集合
 * 
 * @author 郭志斌
 * @date 2019/08/06
 */
@Getter
@Setter
@ToString
@JacksonXmlRootElement(localName = "pid")
public class Pid {

    public Pid(){

    }

    public Pid(PidType type){
        this.type = type;
    }

    /**
     * PID 标识类型
     */
    @JacksonXmlProperty(isAttribute = true, localName = "type")
    private PidType type;

    /**
     * 数据集元数据列表
     */
    @JacksonXmlElementWrapper(localName = "metadatas")
    @JacksonXmlProperty(localName = "metadata")
    private List<@Valid ? extends PidCoreMetadata> metadatas;

}
